# encoding  :  utf-8 _*_
# @author   :  朱清闯
# @software :  PyCharm
# time      :  2022/3/22 17:07
from utils import VerifyUserHasRegistered,VerifyPhoneHasRegistered


def verify(phone,username):
    username_result = VerifyUserHasRegistered.verify(username=username)
    phone_result = VerifyPhoneHasRegistered.verify(phone=phone)
    # 如果用户名或者手机号码已经注册,则直接返回错误
    if not phone_result and not username_result:
        return 9
    elif not username_result:
        return 8
    elif not phone_result:
        return 6
    else:
        return 0